import openpyxl
from Models import ZhifubaoSoup

book = openpyxl.load_workbook('3.xlsx')
print('所有sheet页名称：', book.sheetnames)
sheet = book.worksheets[0]
sheet2 = book['Sheet1']
sheet3 = book[book.sheetnames[0]]
print('工作表名称：', sheet3.title)
rows = sheet.max_row
cols = sheet.max_column
print('该工作表有%d行，%d列.' % (rows, cols))

print(sheet.rows, sheet.columns)
for col in sheet.columns:
    print(col)
for row in sheet.rows:
    data = []
    for index, i in enumerate(row):
        data.append(str(i.value))

    ZhifubaoSoup.ZhifubaoSoup.insert(data)
